﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>title</title>
    <meta content="$homeContent.getURI('favicon.ico')" itemprop="image">
    <link rel="shortcut icon" href="$homeContent.getURI('favicon.ico')" type="image/x-icon"/>
	<link rel="stylesheet" type="text/css" href="assets/login/login/css/index.css" />
	<style type="text/css">
    .download{margin:20px 33px 10px;*margin-bottom:30px;padding:5px;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background:#e6e6e6;border:1px dashed #df0031;font-size:14px;font-family:Comic Sans MS;font-weight:bolder;color:#555}
    .download a{padding-left:5px;font-size:14px;font-weight:normal;color:#555;text-decoration:none;letter-spacing:1px}
    .download a:hover{text-decoration:underline;color:#36F}
    .download span{float:right}
    </style>
    <script type="text/javascript" src="assets/login/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="assets/login/js/jquery.form.min.js"></script>
    <script type="text/javascript" src="assets/login/js/jquery.cookie.js"></script>
    <script type="text/javascript" src="assets/login/login/js/placeholder.js"></script>
</head>

<body>
    <div class="header clr">
        	    <div class="headerLt clr"> <img src="/assets/login/login/images/logo_04.png"/></div>
                <div class="headerRt clr">
            	    <div class="title"><img src="/assets/login/login/images/bt_03.png"/></div>
                    <form id='loginForm' name="login" action="/Home/Login" method="post">
                	    <span>用户名：</span><input class="box" placeholder="请输入用户名" type="text" name="username"/><br/>
                        <span>密&nbsp;&nbsp;&nbsp;码：</span><input class="box"  placeholder="请输入密码"type="password" name="password" /><br />
                        <input class="rebox" type="checkbox" name="remember" checked="checked"/><label>记住密码</label>
                    <div class="login">
                	    <button class="button" type="submit">登&nbsp;&nbsp;录</button>
                    </div>
                    </form>
                </div>
                <div class="headerBot clr">Copyright © 合肥赛为智能有限公司版权所有</div>
    </div>
</body>

@*    <script type="text/javascript">
        $.ajax({
            type: 'POST',
            url: "/Home/LogOff",
            dataType: 'json',
            async: false,
            success: function (responseData) {
                console.log(responseData);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {//请求失败处理函数  
                console.log("请求失败，无法获取分组数据");
            }
        });

    </script>*@

    <script>
        $('#loginForm').submit(function () {
            var myForm = $(this);

            var userVal = myForm.find('input[name="username"]').val();
            var passVal = myForm.find('input[name="password"]').val();
            if (jQuery.trim(userVal) == '' || passVal == '') {
                alert('用户名或密码不能为空');
                myForm.find('input').val('');
                myForm.find('input:first').focus();
                return false;
            }
            myForm.ajaxSubmit({
                success: function (data) {
                    var state = data.status;

                    console.log(state);

                    if (state == 'SUCCESS') {
                        location.href = '/Home/Default';
                    } else if (state == 'FAIL') {
                        alert(data.message);
                        myForm.find('input').val('');
                        myForm.find('input:first').focus();
                    }
                }
            });
            return false;
        });

        if (top.location != self.location) {
            top.location = self.location;
        }
        var username = $.cookie('username');
        var password = $.cookie('password');

        if (username && password) {
            var myForm = $('#loginForm');
            $('input[name="username"]', myForm).val(username);
            $('input[name="password"]', myForm).val(password);
            $('input[name="remember"]', myForm).attr('checked', 'checked');
        }
</script>


</html>
